package com.shanxia.codec.enums;

import java.util.Objects;

public enum SocGoalEnum {

    NOT_REACH(0x00, "未达到所需soc目标值"),
    REACH(0x01, "达到所需soc目标值"),
    UNTRUSTED(0x10, "不可信状态"),
    UNKNOWN(99, "未知");

    public static SocGoalEnum getByCode(int code) {
        for (SocGoalEnum enums : SocGoalEnum.values()) {
            if (Objects.equals(enums.code, code)) {
                return enums;
            }
        }
        return SocGoalEnum.UNKNOWN;
    }

    SocGoalEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int code;
    public String name;
}